﻿using ThunderRoad;
using UnityEngine;

namespace BBYScripts
{
    public abstract class PlayerFly
    {
        public static void ChangeFlyStatus(bool fly)
        {
            Debug.Log("Fly:" + fly);
            if (!Player.local)
            {
                return;
            }
            var rb = Player.local.GetComponent<Rigidbody>();
            if (!rb) return;
            // 设置重力缩放为0，使物体失重
            if (rb.useGravity)
            {
                rb.useGravity = fly;
            }
        }
    }
}